]> dgit.raspbian.org Git - gnome-shell.git/log
gnome-shell.git
3 years agoextensionUtils: Move isOutOfDate() into manager
Florian Müllner [Fri, 14 Jul 2023 12:39:45 +0000 (14:39 +0200)]
extensionUtils: Move isOutOfDate() into manager

It hasn't been used anywhere else since the old prefs-tool stopped
implementing its own extension loading.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2837>

3 years agoextensionUtils: Always use manager to find current extension
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
extensionUtils: Always use manager to find current extension

Now that we always have an extension manager object, we can use
the same code path for use from extensions and prefs.

For that, inject the D-Bus service's extensionManager instead
of the current extension.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Add basic extension manager
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
dbusServices/extensions: Add basic extension manager

ExtensionUtils' getCurrentExtension() method currently either
returns the extension that was injected with setCurrentExtension(),
or imports Main locally to access the extensionManager.

But local imports won't work anymore when we convert to ESM,
and setCurrentExtension() is only an option for prefs.

Instead of diverging the code paths even further, we'll unify
the two cases as much as possible.

As a first step, add a basic extension manager in the Extensions
D-Bus service that exposes the same lookup() API as the "real"
extension manager.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Save stateObj on extension
Florian Müllner [Sun, 9 Jul 2023 00:54:58 +0000 (02:54 +0200)]
dbusServices/extensions: Save stateObj on extension

We don't need it for anything for the time being, but reducing the
differences between extension object in the gnome-shell process and
in preferences still seems a good idea.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Don't use getCurrentExtension()
Florian Müllner [Sun, 9 Jul 2023 10:47:05 +0000 (12:47 +0200)]
dbusServices/extensions: Don't use getCurrentExtension()

The prefs dialog is created on behalf of a particular extension.
It's a bit silly to rely on getCurrentExtension() to access it,
instead of just keeping track of it ourselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodbusServices/extensions: Check earlier for existing dialog
Florian Müllner [Sun, 9 Jul 2023 22:00:04 +0000 (00:00 +0200)]
dbusServices/extensions: Check earlier for existing dialog

There is no point in making a D-Bus call if we are going to bail
out anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agoextensionUtils: Slightly optimize current extension lookup
Florian Müllner [Sun, 9 Jul 2023 23:20:53 +0000 (01:20 +0200)]
extensionUtils: Slightly optimize current extension lookup

When looking for a directory name that matches the extension UUID,
we can just as well use GLib's dirname()/basename() functions
instead of wrapping the path in a GFile.

We also know that the original path corresponds to a regular file
and not a directory, so rearrange the loop to avoid a lookup that
is guaranteed to fail.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agoextensionUtils: Stop using RegExp for stack parsing
Florian Müllner [Sun, 9 Jul 2023 23:20:53 +0000 (01:20 +0200)]
extensionUtils: Stop using RegExp for stack parsing

We currently use a regular expression to extract the exact file path
from a stack line. That RE is no longer accurate:

 - we assume a line number at the end, but at one point the column
   number was added as well
 - stacks from ES modules use file:// URIs instead of plain paths

Luckily that doesn't matter: We don't want to access any actual
files, so all we need is a path that can be traversed and that
contains the UUID.

We can get that with simple string manipulation, so avoid the regex
overhead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>

3 years agodependencies: Migrate to ES module and organize dependencies
Evan Welsh [Mon, 10 Jul 2023 06:34:52 +0000 (23:34 -0700)]
dependencies: Migrate to ES module and organize dependencies

gi modules are always loaded (there is no API for "set version without
loading"), so
we need to break dependencies.js into three sections:

- Required
- Compile-time optional
- Runtime optional

Required dependencies are always imported, compile-time optional
dependencies
are loaded if gnome-shell is compiled with support for them, and for
runtime optional dependencies we catch any errors when attempting to
load them.
If runtime optional dependencies fail to load we log a debug-level
message.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agolayout: Add catch when asynchronously setting up the startup animation
Evan Welsh [Thu, 6 Jul 2023 01:12:39 +0000 (18:12 -0700)]
layout: Add catch when asynchronously setting up the startup animation

This ensures any errors that occur in this stage of startup are clearly
logged.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoscripting: Convert to ES module and migrate tests
Evan Welsh [Thu, 6 Jul 2023 01:08:09 +0000 (18:08 -0700)]
scripting: Convert to ES module and migrate tests

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoenvironment: Port environment.js to be an ES module
Evan Welsh [Mon, 10 Jul 2023 06:05:14 +0000 (23:05 -0700)]
environment: Port environment.js to be an ES module

Removes the init() function in favor of executing all environment
changes when the file is imported.

Additionally ports all unit tests using imports.gi.environment.init() to
use the updated module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Load unit tests as modules
Evan Welsh [Mon, 10 Jul 2023 05:19:40 +0000 (22:19 -0700)]
tests: Load unit tests as modules

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoci: Include tests/ for linting
Florian Müllner [Thu, 13 Jul 2023 20:02:35 +0000 (22:02 +0200)]
ci: Include tests/ for linting

Linting isn't exclusively about coding style, but can detect
actual bugs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests/unit: Fix remaining ESLint errors
Evan Welsh [Mon, 10 Jul 2023 05:59:46 +0000 (22:59 -0700)]
tests/unit: Fix remaining ESLint errors

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests/shell: Fix remaining ESlint errors
Florian Müllner [Thu, 13 Jul 2023 19:29:13 +0000 (21:29 +0200)]
tests/shell: Fix remaining ESlint errors

All tests are currently excluded from linting, so errors can sneak
in more easily.

We should change that, so quickly fix up any remaining errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoinsertSorted: Refactor comparator functions to be arrow functions
Evan Welsh [Mon, 10 Jul 2023 05:58:22 +0000 (22:58 -0700)]
insertSorted: Refactor comparator functions to be arrow functions

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Move assertArrayEquals to shared assertions file
Evan Welsh [Mon, 10 Jul 2023 05:56:26 +0000 (22:56 -0700)]
tests: Move assertArrayEquals to shared assertions file

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agotests: Use gjs_context_eval_file to evaluate test scripts
Evan Welsh [Mon, 10 Jul 2023 05:24:48 +0000 (22:24 -0700)]
tests: Use gjs_context_eval_file to evaluate test scripts

GJS provides utilities to run scripts given a filename, using those
utilities we can remove most of the logic implementing file loading.

Additionally the REPL logic does not make much sense for a test
runner and is unused, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agodependencies: Specify versions of Shell/St
Florian Müllner [Thu, 13 Jul 2023 22:23:26 +0000 (00:23 +0200)]
dependencies: Specify versions of Shell/St

We started to version them last cycle, so docs can be differentiated
between versions. It is not *expected* that two versions show up
on the same system, but then it also doesn't hurt handling it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoenvironment: Split dependencies loading into a new file
Evan Welsh [Mon, 10 Jul 2023 06:21:23 +0000 (23:21 -0700)]
environment: Split dependencies loading into a new file

Once environment.js is an ES module we need to ensure we can dynamically
specify the version for required GI dependencies such as Clutter.

Moving dependency version setup to dependencies.js ensures gi.require
calls are done before environment.js imports any utilities.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoanimationUtils: Group together various animation helpers
Evan Welsh [Mon, 10 Jul 2023 04:58:21 +0000 (21:58 -0700)]
animationUtils: Group together various animation helpers

The environment module is used to initialize the environment, yet it
currently also defines the adjustAnimationTime() function.

Ideally it should not export any utility functions, in particular
once converted to ESM.

The function cannot be moved to the existing Utils module, as that
depends on an initialized environment, and can therefore not be
imported from environment.js, so use that opportunity to group
together several animation helpers in a new animationUtils module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>

3 years agoci: Bump mutter image
Florian Müllner [Sat, 15 Jul 2023 01:27:22 +0000 (03:27 +0200)]
ci: Bump mutter image

Eieiei, mutter now depends on libei.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2846>

3 years agolookingGlass: Evaluate command asynchronously
Florian Müllner [Wed, 12 Jul 2023 19:40:05 +0000 (21:40 +0200)]
lookingGlass: Evaluate command asynchronously

This allows using await in the command (or the header we
add to it), for example when handling Promises or importing
a module dynamically.

The latter will be crucial when porting to ESM.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Reformat command header
Florian Müllner [Wed, 12 Jul 2023 19:32:56 +0000 (21:32 +0200)]
lookingGlass: Reformat command header

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Make getCompletions() asynchronous
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
jsParse: Make getCompletions() asynchronous

Part of the possible completions involves evaluating the part
of the passed in text that looks like an object, so that we
can query it for properties.

Using a Function or eval() for that means that we can only
complete text that does not use `await`. To get over that
limitation, evaluate the text in an AsyncFunction instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Replace eval()
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
jsParse: Replace eval()

The evil() function is considered eval, replace it like we
already did in looking glass.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agojsParse: Use JSDoc to document functions
Evan Welsh [Mon, 10 Jul 2023 09:25:01 +0000 (02:25 -0700)]
jsParse: Use JSDoc to document functions

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Handle completions asynchronously
Florian Müllner [Wed, 12 Jul 2023 23:52:06 +0000 (01:52 +0200)]
lookingGlass: Handle completions asynchronously

They will actually become asynchronous in a following commit,
prepare for that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolookingGlass: Handle unprintable object
Florian Müllner [Wed, 12 Jul 2023 22:25:43 +0000 (00:25 +0200)]
lookingGlass: Handle unprintable object

We currently throw an error when encountering a result that cannot
be represented as string, with the prompt appearing somewhat stuck
(the input cannot be committed).

Showing a lame fallback instead at least avoids that issue. When
the object has a typeof 'object' but is not an instanceof Object,
we are likely dealing with an ES module, and can show a slightly
less lame fallback.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agolint: Relax jsdoc requirement
Florian Müllner [Thu, 13 Jul 2023 00:55:10 +0000 (02:55 +0200)]
lint: Relax jsdoc requirement

Requiring a description for every parameter even in internal
functions or in obvious cases ("actor - the actor") is cumbersome,
so relax that rule.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>

3 years agotests: Use different suites
Florian Müllner [Thu, 13 Jul 2023 22:40:09 +0000 (00:40 +0200)]
tests: Use different suites

This makes it easier to only run unit- or automation tests.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2845>

3 years agoa11y: Don't create a parent loop for quick settings sliders
Lukáš Tyrychtr [Thu, 11 May 2023 09:19:36 +0000 (11:19 +0200)]
a11y: Don't create a parent loop for quick settings sliders

Rather than returning the parent container of the slider, which presents
itself as the slider, return the parent of the slider container.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6686

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2762>

3 years agoextensions-app: Style development window
Florian Müllner [Wed, 12 Jul 2023 14:46:29 +0000 (16:46 +0200)]
extensions-app: Style development window

Libadwaita includes a standard style class to distinguish
nightly/development versions from regular instances, but
we never to around applying it.

Do that now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2841>

3 years agoextensions-app: Include a non-fake Config
Florian Müllner [Wed, 12 Jul 2023 14:46:29 +0000 (16:46 +0200)]
extensions-app: Include a non-fake Config

We currently include a fake config.js file to satisfy the indirect
import from ExtensionUtils. However we're about to need to pass
build-time information into the program ourselves, so generate
a proper file.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2841>

3 years agost/icon-theme: Remove special-casing of symbolic lookup
Florian Müllner [Wed, 5 Jul 2023 19:20:36 +0000 (21:20 +0200)]
st/icon-theme: Remove special-casing of symbolic lookup

GThemedIcon considers the "-symbolic" suffix when generating
fallback names (i.e. "foo-bar-symbolic", "foo-symbolic", "foo-bar",
"foo").

That means now that we prefer more accurate name matches from any
theme over fallback matches from higher-priority themes, we no
longer need to special-case symbolic names for preferring symbolic
matches over full-color fallbacks.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2824>

3 years agost/icon-theme: Pick best-matching name from all themes
Florian Müllner [Wed, 5 Jul 2023 19:01:17 +0000 (21:01 +0200)]
st/icon-theme: Pick best-matching name from all themes

When resolving an icon name, we currently look in all themes in
order whether one of the requested names matches.

That means, a "keyboard" icon from the configured theme will
trump over any of "keyboard-shift", "keyboard-brightness" and
"keyboard-preferences" from lower-ranked themes (like "Adwaita"
and "hicolor").

That applies to custom icons we include in the resource, which
are added to the fallback ("hicolor") theme.

We are less bound by the named-icons spec than GTK, so we can
adapt the lookup to prefer the most accurate match to matches
from the highest priority theme.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2824>

3 years agotests/shell: Also import built-in modules as modules
Florian Müllner [Tue, 11 Jul 2023 14:43:02 +0000 (16:43 +0200)]
tests/shell: Also import built-in modules as modules

The "System" module is provided by gjs itself, and also available
as module.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2836>

3 years agotests/shell: Import introspected libraries as modules
Florian Müllner [Tue, 11 Jul 2023 12:57:41 +0000 (14:57 +0200)]
tests/shell: Import introspected libraries as modules

Since commit 5e93791708 tests scripts are loaded as modules,
so we can (and should) use "proper" imports.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2835>

3 years agokeyboard: Spawn "tecla" to show keyboard map
Carlos Garnacho [Mon, 3 Jul 2023 09:44:17 +0000 (11:44 +0200)]
keyboard: Spawn "tecla" to show keyboard map

This is a modern replacement for gkbd-keyboard-display, stuck in gtk3
and X11 (libxklavier).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2834>

3 years agoci: Print eslint results to stdout as well
Florian Müllner [Sat, 8 Jul 2023 11:06:05 +0000 (13:06 +0200)]
ci: Print eslint results to stdout as well

The eslint jobs report their results as artifacts in junit format,
so that gitlab can present them in its UI.

However many people miss that, and unsuccessfully check the logs
instead.

Account for that by also printing the results to stdout.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2829>

3 years agomain: Replace custom log function with console
Florian Müllner [Mon, 1 Aug 2022 09:26:59 +0000 (11:26 +0200)]
main: Replace custom log function with console

console.log() is implemented with structured logging, and as we
set an appropriate log domain, it's identical to the custom function
bar the custom fields with extension data.

Few people know about those custom fields, and adding them comes
at a cost, as we end up producing and parsing a stacktrace on
every log() call.

It therefore seems appropriate to drop the custom function, and
turn the global log() symbol into a simple convenience alias for
console.log().

If it turns out that people do miss the custom fields, we can add
an alternative to ExtensionUtils.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2830>

3 years agomain: Remove log compatibility
Florian Müllner [Mon, 1 Aug 2022 09:22:06 +0000 (11:22 +0200)]
main: Remove log compatibility

global.log() hasn't been used since 3.6. It seems extremely unlikely
that any extensions are still using it, not least because `log()` is
more convenient.

Time to move on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2830>

3 years agoextensionSystem: Fix signal disconnection
Florian Müllner [Sun, 9 Jul 2023 20:26:29 +0000 (22:26 +0200)]
extensionSystem: Fix signal disconnection

The ::shutdown signal is on Shell.Global, not Meta.Context 🤦️

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2831>

3 years agodateUtils: Refactor so all utilities use cached local timezone
Evan Welsh [Sat, 8 Jul 2023 01:20:26 +0000 (18:20 -0700)]
dateUtils: Refactor so all utilities use cached local timezone

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2827>

3 years agoenvironment: Remove toLocaleFormat and add dateUtils for date formatting
Evan Welsh [Sat, 8 Jul 2023 00:58:11 +0000 (17:58 -0700)]
environment: Remove toLocaleFormat and add dateUtils for date formatting

`toLocaleFormat` is now `formatDateWithCFormatString` and formatTime and
formatTimeSpan are moved into dateUtils.

Instead of overriding system.clearDateCaches, add a helper in dateUtils.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2827>

3 years agodateMenu: Fix lint errors prior to refactor
Evan Welsh [Fri, 7 Jul 2023 20:12:49 +0000 (13:12 -0700)]
dateMenu: Fix lint errors prior to refactor

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2827>

3 years agotests: Stop bundling "perf" tests with gnome-shell
Florian Müllner [Tue, 27 Jun 2023 18:27:53 +0000 (20:27 +0200)]
tests: Stop bundling "perf" tests with gnome-shell

Now that scripts are loaded as external modules, there's no reason
anymore for bundling them with the gnome-shell executable. Just
move the scripts into a dedicated folder in tests/ and run them
from there.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>

3 years agotest-tool: Require script argument
Florian Müllner [Fri, 7 Jul 2023 13:36:18 +0000 (15:36 +0200)]
test-tool: Require script argument

The purpose of the tool has shifted from running a limited set
of performance tests repeatedly to collect performance data
and catch regressions, to a wrapper that drives gnome-shell via
scripts for tests.

With that, the concept of a "default" script doesn't really make
sense anymore.

Instead, turn the argument from an optional flag into a required
parameter. This will allow us to stop bundling the existing tests
in a follow-up commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>

3 years agotest-tool: Rename perf-tool
Florian Müllner [Tue, 27 Jun 2023 18:22:28 +0000 (20:22 +0200)]
test-tool: Rename perf-tool

The original purpose of the tool was to collect performance data
that would optionally be uploaded to a server in Owen's living
room. While the corresponding scripts are still included (although
the server was probably dismantled years ago), the tool is mainly
used for running gnome-shell with scripted tests nowadays.

Rename the tool to reflect that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>

3 years agomain: Pass script on CLI instead of via environment
Florian Müllner [Tue, 13 Jun 2023 01:53:32 +0000 (03:53 +0200)]
main: Pass script on CLI instead of via environment

Environment variables aren't the best option to pass parameters
to a process (wouldn't it be "fun" if SHELL_PERF_MODULE appeared
in a regular user session?).

Instead, use a (hidden) --automation-script command line flag to
specify a script file that should be used to drive an automated
session.

As a side effect, the script no longer has to be relative to the
main module itself, so it will be possible to run scripts that
aren't bundled with the shell sources.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>

3 years agomain: Load perf scripts as modules
Florian Müllner [Tue, 13 Jun 2023 00:13:01 +0000 (02:13 +0200)]
main: Load perf scripts as modules

The perf scripts that can be used to script the gnome-shell UI
for testing are sufficiently separate from the rest of the code
base to allow porting them to ESM modules before the rest of
the code base.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>

3 years agoci: Look for matching ref in user remote for branch pipeline
Florian Müllner [Sat, 1 Jul 2023 18:25:52 +0000 (20:25 +0200)]
ci: Look for matching ref in user remote for branch pipeline

We currently only find a matching ref on the same remote in
a merge request pipeline, but not in branch pipelines.

It can occasionally be useful to run a pipeline without opening
a merge request, so try the same remote here as well instead of
just assuming origin.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2814>

3 years agoextensionSystem: Remove "disable" file on shutdown
Florian Müllner [Mon, 12 Jun 2023 21:28:54 +0000 (23:28 +0200)]
extensionSystem: Remove "disable" file on shutdown

The file indicates to the systemd shutdown scripts that extensions
should be disabled, so that extensions that crash the shell on
startup cannot lock out the user indefinitely.

For that purpose, we create the file before initializing extensions,
and remove it after 60 seconds. That generally works, because it's
highly unlikely that a session genuinely ends within the first minute.

It's possible though (for example during developments or when running
tests), so also remove the file when shutting down cleanly before
the timeout.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2807>

3 years agoextensions-tool: Adjust templates
Florian Müllner [Thu, 1 Jun 2023 22:47:22 +0000 (00:47 +0200)]
extensions-tool: Adjust templates

Extensions are now loaded as modules, so adjust the templates
accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2795>

3 years agoextensionUtils: Remove installImporter()
Florian Müllner [Thu, 8 Jun 2023 16:36:48 +0000 (18:36 +0200)]
extensionUtils: Remove installImporter()

The method is now unused, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2795>

3 years agodbusServices/extensions: Load preferences as module
Florian Müllner [Fri, 2 Jun 2023 02:12:34 +0000 (04:12 +0200)]
dbusServices/extensions: Load preferences as module

Now that extensions themselves are imported as modules, do the
same for their preference dialogs.

Extensions must now export a class with a `fillPreferencesWindow()`
method as default.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2795>

3 years agoextensionSystem: Load extensions as modules
Florian Müllner [Thu, 1 Jun 2023 22:47:22 +0000 (00:47 +0200)]
extensionSystem: Load extensions as modules

Continue the move to ESM by loading modules dynamically with
the standard import() expression, rather than by installing a
custom (legacy) importer.

This is a breaking change that affects all extensions, as they
now need to explicitly export the expected symbols.

As we are already breaking all extensions, take that opportunity
and remove support for the individual entry points: Using a
class with enable()/disable() methods has been the recommended
pattern for a long time, it is now the only entry point.

Instead of instantiating the class from an `init()` function,
the class must now be exported as default to be recognized.

Additionally, we no longer install an importer on the extension
object, so extensions that consist of more than one file MUST
import those files as modules now.

There will be a second breaking change for extensions when
gnome-shell's own code is ported to ESM, so most extension
developers will likely want to wait until the port is complete
before starting to port their extensions.

Based on a commit from Evan Welsh.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2795>

3 years agoBump version to 45.alpha
Florian Müllner [Mon, 3 Jul 2023 18:26:29 +0000 (20:26 +0200)]
Bump version to 45.alpha

Update NEWS.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2817>

3 years agobuild: Bump mutter API version
Florian Müllner [Mon, 3 Jul 2023 18:33:00 +0000 (20:33 +0200)]
build: Bump mutter API version

This slipped so far this cycle, let's do it in time for the alpha
release.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2817>

3 years agoci: Print ESLint version before running script
Evan Welsh [Thu, 8 Jun 2023 06:21:40 +0000 (23:21 -0700)]
ci: Print ESLint version before running script

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2821>

3 years agoanimations: Stop syncing size manually
Florian Müllner [Fri, 9 Jun 2023 18:12:15 +0000 (20:12 +0200)]
animations: Stop syncing size manually

The returned slice actors are now set up to fill their parent,
accounting for any difference between loaded- and displayed size,
so we can stop syncing the size manually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2798>

3 years agost/texture-cache: Set up sliced images to fill parent
Florian Müllner [Fri, 9 Jun 2023 17:52:15 +0000 (19:52 +0200)]
st/texture-cache: Set up sliced images to fill parent

When using fractional scaling, the size of the loaded image with
applied scaling may still differ from the displayed size. This
is currently addressed by syncing the size of all slice actors
in the (probably only) caller.

Instead, set the actors to fill their parent automatically.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2798>

3 years agoshell/util: Use gtk4 for week-start fallback
Florian Müllner [Mon, 3 Jul 2023 17:32:13 +0000 (19:32 +0200)]
shell/util: Use gtk4 for week-start fallback

If langinfo isn't available, we determine the week start via
a "magic" string translation from GTK. We currently look up
the string in GTK3's domain, we should use GTK4's instead.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2816>

3 years agobuild: Specify systemd version requirement
Joan Torres [Fri, 16 Jun 2023 14:23:30 +0000 (16:23 +0200)]
build: Specify systemd version requirement

Since we are specifying in the unit files a comment of requiring
systemd >= 246, set the req at buildtime and drop the comment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2800>

3 years agoUpdate British English translation
Bruce Cowan [Fri, 30 Jun 2023 19:20:43 +0000 (19:20 +0000)]
Update British English translation

(cherry picked from commit f3ccc0d23a3da42ef820f70f1eaa4d6962c5bb50)

3 years agotests: Remove interactive tests
Florian Müllner [Thu, 22 Jun 2023 16:10:48 +0000 (18:10 +0200)]
tests: Remove interactive tests

The tests rely on the ability to run Clutter as stand-alone app,
which hasn't been possible for quite a while now. Event handling
was broken long before that, plus tests that need a human to run
them and evaluate the result aren't that useful to begin with.

It would be neat to test our CSS rendering by setting up a stage,
capturing it and comparing it to a reference image. But writing
some code that exercises backgrounds, borders etc. is hardly the
obstacle to make that happen, and not worth carrying around dead
code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2811>

3 years agoRevert "ci: Wrap calls with sudo when building toolbox"
Florian Müllner [Wed, 28 Jun 2023 21:37:59 +0000 (23:37 +0200)]
Revert "ci: Wrap calls with sudo when building toolbox"

This was necessary after mutter configured a non-root user
for the image, although as it turned out not sufficient.

The latest image no longer sets up a special user, so building
the toolbox image should work again as before.

This reverts commit ee384d85dac1b0582613bea9263424c9c197839e.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2813>

3 years agoci: Bump mutter image
Florian Müllner [Wed, 28 Jun 2023 21:36:29 +0000 (23:36 +0200)]
ci: Bump mutter image

Mutter stopped hardcoding a non-default user in the image, and
instead wraps its CI tests to run as user. Pull in that image
to hopefully get over some of the recent CI hickups.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2813>

3 years agoUpdate Hebrew translation
Yosef Or Boczko [Wed, 28 Jun 2023 07:34:52 +0000 (07:34 +0000)]
Update Hebrew translation

3 years agowindowManager: Add shortcut for toggling quick settings
Florian Müllner [Tue, 21 Mar 2023 16:07:19 +0000 (17:07 +0100)]
windowManager: Add shortcut for toggling quick settings

Ever since the various status menus were combined into a single
aggregate menu, the menu has been an important entry point. Alas,
we never got around to adding a shortcut for it, not least because
there never was a good candidate.

We just freed super+s which works as either "system" or
"(quick) settings", so use that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2716>

3 years agowindowManager: Reindent shortcuts setup
Florian Müllner [Tue, 21 Mar 2023 17:09:08 +0000 (18:09 +0100)]
windowManager: Reindent shortcuts setup

We require all new code to use the non-legacy style. Updating code
on a case-by-case basis works fairly well most of the time, but
here we have a big uniform block, where any addition with a different
style would stick out badly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2716>

3 years agodata: Unset default shortcut for 'toggle-overview'
Florian Müllner [Wed, 12 Apr 2023 16:11:51 +0000 (18:11 +0200)]
data: Unset default shortcut for 'toggle-overview'

The keybinding is a direct, less commonly used alternative to
stand-alone 'super'. While it can be useful to have a regular
keybinding alternative - although 'super+alt+up' also provides
that to some extent - most users probably don't even know about
it's existence.

It is therefore less justified to take away a valuable shortcut
slot, so stop assigning a default shortcut to free 'super+s' for
other actions.

Users who do use the keybinding can still use Settings to assign
a shortcut.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2716>

3 years agojs: Fix linting errors from line shifts
Evan Welsh [Thu, 8 Jun 2023 04:53:07 +0000 (21:53 -0700)]
js: Fix linting errors from line shifts

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>

3 years agojs: Split gi imports to be on new lines to prepare for ES modules
Evan Welsh [Thu, 8 Jun 2023 04:52:46 +0000 (21:52 -0700)]
js: Split gi imports to be on new lines to prepare for ES modules

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>

3 years agoportalHelper: Port to ESM
Florian Müllner [Thu, 25 May 2023 20:22:09 +0000 (22:22 +0200)]
portalHelper: Port to ESM

The helper app that provides the login dialog for network portals
is another separate process that can be moved to ESM separately.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>

3 years agoportalHelper: Stop using non-default ARGV vector
Florian Müllner [Tue, 30 May 2023 12:41:36 +0000 (14:41 +0200)]
portalHelper: Stop using non-default ARGV vector

If gjs itself defines ARGV, it only holds the arguments that are
passed on to the script, and javascript code should combine the
programName and ARGV (or the newer programArgs) when it needs a
C-style argv array.

Do the same in the portal-helper process instead of passing along
the original C argv, to avoid confusion when accessing the arguments
from javascript.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>

3 years agoextensions-app: Port to ESM
Florian Müllner [Thu, 25 May 2023 19:23:24 +0000 (21:23 +0200)]
extensions-app: Port to ESM

The extensions app is another part of the code base that is largely
separate from the main code base, and can therefore be ported to
ESM before the big switch.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>

3 years agodbusServices: Port to ESM
Florian Müllner [Thu, 25 May 2023 18:31:22 +0000 (20:31 +0200)]
dbusServices: Port to ESM

We want to replace gjs' custom (and now legacy) imports system
with standard EcmaScript modules: JS developers are already
familiar with them, they have better tooling support and using
standard features over non-standard ones is generally the right
thing to do.

Our D-Bus services are separate from the main process, and thus
can be ported separately (except for the few imports that are
shared with the main process' code base).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>

3 years agopanel: Stylesheet updates and minor improvements for panel buttons
Sam Hewitt [Mon, 19 Jun 2023 19:52:29 +0000 (17:22 -0230)]
panel: Stylesheet updates and minor improvements for panel buttons

- spin out all the panel button styling into a drawing mixin
- clean up the styles generally
- make special cases for the clock and non-flat buttons
- contrast fixes for non-flat buttons, fixes #6768
- new stop icon for the screen recording/cast indicators

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2804>

3 years agoworkspace: Reapply border radius on background changes
Florian Müllner [Mon, 19 Jun 2023 00:24:47 +0000 (02:24 +0200)]
workspace: Reapply border radius on background changes

The rounded corner effect is applied to the background actor, so
we have to reapply the correct values when the background changes
for the corners to persist.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4125

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2801>

3 years agoci: Wrap calls with sudo when building toolbox
Florian Müllner [Tue, 20 Jun 2023 00:21:47 +0000 (02:21 +0200)]
ci: Wrap calls with sudo when building toolbox

The mutter image now sets up a non-root default user, so we have
to wrap everything with sudo or su.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2806>

3 years agoci: Bump mutter image
Florian Müllner [Mon, 19 Jun 2023 21:15:13 +0000 (23:15 +0200)]
ci: Bump mutter image

The updated image contains a recent enough libadwaita version to
run the extensions app after commit 38243410.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2805>

3 years agosubprojects/shew: Adjust to GTK deprecation
Florian Müllner [Sat, 27 May 2023 13:00:43 +0000 (15:00 +0200)]
subprojects/shew: Adjust to GTK deprecation

GTK 4.12 deprecates gdk_wayland_toplevel_unexport_handle() in favor
of the new gdk_wayland_toplevel_drop_exported_handle(). We are not
bound by API stability, so we can just expose the additional argument
that the replacement requires instead of tracking the handle
internally.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2778>

3 years agowindow: Move search button to the start
Christopher Davis [Mon, 19 Jun 2023 01:33:06 +0000 (21:33 -0400)]
window: Move search button to the start

Matches AdwPreferencesWindow.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2802>

3 years agowindow: Port to AdwToolbarView
Christopher Davis [Mon, 19 Jun 2023 00:55:38 +0000 (20:55 -0400)]
window: Port to AdwToolbarView

Applications should use AdwToolbarView going forward to contain
their headerbar and content.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2802>

3 years agowindow: Port to AdwApplicationWindow
Christopher Davis [Mon, 19 Jun 2023 00:53:30 +0000 (20:53 -0400)]
window: Port to AdwApplicationWindow

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2802>

3 years agoextensions-app: Extend build instructions
Martin Zurowietz [Tue, 13 Jun 2023 19:05:49 +0000 (21:05 +0200)]
extensions-app: Extend build instructions

Related to #6575

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2799>

3 years agoparentalControlsManager: Don't log error when disabled
Florian Müllner [Fri, 9 Jun 2023 13:41:03 +0000 (15:41 +0200)]
parentalControlsManager: Don't log error when disabled

We currently special-case the DISABLED error when initializing
filtering, but not on app filter changes.

While it seems reasonable that Malcontent.Manager wouldn't emit
the signal while disabled, that's not actually true: It is emitted
when any user account information tracked by AccountsServices
changes.

Even if the signal were limited to changes of the ParentalControls
extension, it would still get emitted when app filtering *becomes*
disabled.

So regardless of potential improvements in libmalcontent itself,
we should filter out the DISABLED consistently, both when creating
the initial filter and when updating it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6749

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2796>

3 years agoUpdate Slovak translation
Dušan Kazik [Thu, 8 Jun 2023 14:09:24 +0000 (14:09 +0000)]
Update Slovak translation

(cherry picked from commit 113bcb4b106ffd146ee2632d7fe8c9fb0156e058)

3 years agomagnifier: Fix cursor offset
Андрей Гриценко [Mon, 29 May 2023 14:42:13 +0000 (17:42 +0300)]
magnifier: Fix cursor offset

Commit c449058d447c2588d changed the pointer clone to use a single
actor. However that broke applying the hotspot translation to the
position, so the magnified cursor is now displayed with a shift.

Undo the change to restore the old behavior.

This reverts commit c449058d447c2588de81df2e2bd7a1ae98c4060f.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2780>

3 years agoinit: Move Meta main loop into JavaScript after GJS context is initialized
Evan Welsh [Wed, 7 Jun 2023 15:58:08 +0000 (08:58 -0700)]
init: Move Meta main loop into JavaScript after GJS context is initialized

gjs now has an internal mainloop that it can spin to resolve
module imports. That loop uses the thread default context,
so its possible that other sources, namely from mutter, get
dispatched when iterating the context. If that happens before
mutter is properly initialized, this will lead to a crash.

GjsContext needs to iterate its internal mainloop when initializing
to resolve internal modules, to avoid iterating Meta's mainloop and
triggering events before Meta is ready we will initialize the Shell
global and thus the GjsContext (js_context) before Meta.

Once GjsContext is initialized, we can call meta_context_setup().
Once Meta is setup and started, we'll run init.js which uses GJS'
internal promises API to set a "mainloop hook". The mainloop hook
is run immediately after the module returns so GJS will not attempt
to iterate the main loop again before exiting.

Also adjust the 'headlessStart' test to not wait for the
MetaContext::started signal, as that signal has now already
been emitted when the code is executed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6691

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2781>

3 years agopanel: Refactor quick settings loading for asynchronous imports
Evan Welsh [Wed, 7 Jun 2023 15:30:29 +0000 (08:30 -0700)]
panel: Refactor quick settings loading for asynchronous imports

When the Shell ports to ESM, our inline imports of the network and
bluetooth indicators will no longer be possible, refactor quick settings
to load indicators asynchronously.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2563>

3 years agoanimation: Don't get size information until spinner has a parent
Evan Welsh [Wed, 7 Jun 2023 15:47:50 +0000 (08:47 -0700)]
animation: Don't get size information until spinner has a parent

get_size() in _syncAnimationSize() can't be called until the actor
has a parent, otherwise we'll get an error for calling
st_get_theme_node() prior to the actor being on a stage.

_syncAnimationSize() is called asynchronously via
textureCache.load_sliced_image() and there is currently no guarantee
the actor will actually be "loaded" prior to calling it.

This becomes a more obvious error/issue when refactoring parts of the
Shell loading to also be asynchronous.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2563>

3 years agoci: Migrate eslint-plugin-jsdoc rule and pin eslint versions
Evan Welsh [Wed, 7 Jun 2023 06:23:54 +0000 (23:23 -0700)]
ci: Migrate eslint-plugin-jsdoc rule and pin eslint versions

Pin eslint to v8 and eslint-plugin-jsdoc to v46, migrate the removed
jsdoc rule.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2792>

3 years agoUpdate Russian translation
Julia Dronova [Wed, 7 Jun 2023 16:00:05 +0000 (16:00 +0000)]
Update Russian translation

3 years agoshell/perf-helper: Port to GTK4
Florian Müllner [Thu, 13 Apr 2023 20:39:29 +0000 (22:39 +0200)]
shell/perf-helper: Port to GTK4

After the preparations in the previous commits, the port is now
fairly straight-forward.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>

3 years agoshell/perf-helper: Use custom widget as content
Florian Müllner [Mon, 17 Apr 2023 23:52:26 +0000 (01:52 +0200)]
shell/perf-helper: Use custom widget as content

The windows we create use a simple pattern as content, as that's
easier to follow than completely empty windows. GTK4 no longer
allows hooking into the drawing of arbitrary widgets, so prepare
for that by using a dedicated subclass instead of a signal handler.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>

3 years agoshell/perf-helper: Use custom CSS for background
Florian Müllner [Tue, 18 Apr 2023 01:35:17 +0000 (03:35 +0200)]
shell/perf-helper: Use custom CSS for background

GTK4 no longer has the concept of "app-paintable" to skip the
default background drawing. Prepare for that by setting the
desired background via CSS and draw on top of that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>

3 years agoshell/perf-handler: Use app to track window
Florian Müllner [Fri, 14 Apr 2023 23:35:42 +0000 (01:35 +0200)]
shell/perf-handler: Use app to track window

GtkApplication already tracks its windows, so we don't have to
maintain our own list.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>